#include <iostream>

int main() {
    int degrees, minutes, seconds;
    std::cin >> degrees >> minutes >> seconds;
    if (degrees < 0 || minutes < 0 || minutes >= 60 || seconds < 0 || seconds >= 60) {
        std::cout << "invalid input" << std::endl;
    } else {
        double result = degrees + minutes / 60.0 + seconds / 3600.0;
        std::cout << result << std::endl;
    }
    return 0;
}